home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 43.zip
/
Sources C- WorkDisk V.adf
/
peck
/
list1.c
< prev
next >
Wrap
C/C++ Source or Header
|
1987-02-15
|
677b
|
41 lines
/* list example 3.1. p.57 Peck */
#include "exec/types.h"
#include "exec/lists.h"
struct MyListItem
{
struct Node n;
char *data;
};
main()
{
struct MyListItem mli[3];
struct MyListItem *mynode;
struct List MyListHead;
int i;
NewList(&MyListHead); /* init the list header */
mli[0].data = "first";
mli[1].data = "second";
mli[2].data = "third";
for(i=0;i<9;i++)
{
AddTail(&MyListHead, &mli[i%3]);
printf("Just included item nr %d whose data is %ls\n",i,mli[i%3].data);
}
for(i=0;i<9;i++)
{
mynode = (struct MyListItem *) RemTail(&MyListHead);
printf("Just removed item whose data is : %ls\n",mynode->data);
}
} /* ====== end of main ====== */